<form
name="register"
action=""
onSubmit = "return validate(this)"
method="get">

<input type="text"
       name="email"
       value=""
        />
  <input type="submit" value="Please Submit!!" />
</form>

<script type="text/javascript">
  function validate(obj){
    var oEmail = obj.email;
    if(oEmail.value == "") {
      alert("Please enter Email ID");
      oEmail.focus();
      return false;
    }
    return true;
  }
</script>
